package com.class06.controller;

import com.class06.properties.Cats;
import com.class06.properties.StudentMessage;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@ResponseBody // 指定响应字符串
@RequestMapping("/hello") // 指定请求路径
public class HelloController {
    @RequestMapping("/world")
    public String hello(){
        return "hello world";
    }


    @Autowired
    private StudentMessage studentMessage;

    @RequestMapping("/student")
    public String student(){
        return studentMessage.toString();
    }



//    1、导入依赖 ：指定父pom 依赖项及 当前所用的场景启动器
//    2、编写主启动类
//    3、编写业务类

    @Resource
    private Cats cat;

    @RequestMapping("/cat")
    public String getCat(){
        return cat.toString();
    }

}
